import numpy as np
from matplotlib import pyplot as plt

# 散点图
n = 50
# x = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
# y = np.array([2, 30, 4, 15, 6, 7, 28, 9, 17, 11])
# 随机生成数据
x = np.random.randn(n)
y = np.random.randn(n)
color = np.random.randn(n)  # 随机颜色
size = (20 * np.random.randn(n))**2   # 随机大小

plt.scatter(x, y, c=color, s=size, alpha=0.5)
plt.show()
